#pragma once
#include "basic/types.h"
#include "obj.h"
#include "role.h"
#include "utils.h"

struct Unit {
  bool targeting_player() const;
  uint32 creature_type() const;
  bool combating() const;
  bool lootable() const;
  float x() const;
  float y() const;
  float z() const;
  float h() const;
  float v() const;
  uint32 hp() const;
  uint32 hp_max() const;
  uint32 mp() const;
  uint32 mp_max() const;
  uint32 level() const;
  uint32 casting() const;
  uint32 channel() const;
  std::string name() const;
  uintptr ptr() const;
  ObjType type() const;
  uint32 index() const;
  uint64 tid1() const;
  uint64 tid2() const;
  uint64 id1() const;
  uint64 id2() const;
  Role role() const;
  // --- Constructors ---
  // FIXME: 需要 base_ 吗? 以后生物类型可能需要, 先不加
  Unit(uint64 ptr);
  Unit() = delete;
  Unit(Unit &&) = default;
  Unit(const Unit &) = default;
  Unit &operator=(Unit &&) = default;
  Unit &operator=(const Unit &) = default;
  ~Unit();

private:
  Obj obj_;
  Role role_;
  std::string name_;
};
